<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>就业调查</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="format-detection" content="telephone=no">
        <link rel="stylesheet" href="/woniu/Public/X-admin/css/x-admin.css" media="all">
        <style>
            h1{
              font-size:26px;
              padding:10px 5px;
            }
        </style>
    </head>
    <body>
        <div class="x-nav">
            <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新"><i class="layui-icon" style="line-height:29px">ဂ</i> <i class="layui-icon" style="line-height:30px">刷新</i></a>
        </div>
	     
        <div class="x-body">
			<form class="layui-form layui-form-pane" action="/woniu/index.php/Home/Obtain/insert" method="post">

				<h1>就业愿望</h1>
				<div class="layui-form-item" >
	                <label class="layui-form-label" >就业方式</label>
	                <div class="layui-input-inline">
	                  <select name="obtainMode" lay-verify="required">
	                    <option value="">--请选择--</option>
	                    <option value="推荐就业">推荐就业</option>
	                    <option value="自主就业">自主就业</option>
	                    <option value="创业">创业</option>
	                    <option value="回原单位">回原单位</option>
	                  </select>
	                </div>
	            </div>
	            <div class="layui-form-item" >
	                <label class="layui-form-label" >就业地域</label>
	                <div class="layui-input-inline">
	                  <select name="obtainCity" lay-verify="required">
	                    <option value="">--请选择--</option>
	                    <option value="哪里都行">哪里都行</option>
	                    <option value="北京">北京</option>
	                    <option value="南京">南京</option>
	                    <option value="上海">上海</option>
	                    <option value="杭州">杭州</option>
	                    <option value="深圳">深圳</option>
	                    <option value="广州">广州</option>
	                  </select>
	                </div>
	            </div>
	            <div class="layui-form-item" >
	                <label class="layui-form-label">就业职位</label>
	                <div class="layui-input-inline">
	                  <select name="obtainJob" lay-verify="required">
	                    <option value="">--请选择--</option>
	                    <option value="PHP程序员">PHP程序员</option>
	                    <option value="产品助理">产品助理</option>
	                    <option value="技术支持">技术支持</option>
	                    <option value="兄弟连讲师">兄弟连讲师</option>
	                    <option value="项目经理">项目经理</option>
	                    <option value="兄弟连班主任">兄弟连班主任</option>
	                  </select>
	                </div>
	            </div>
	            <div class="layui-form-item" >
	                <label class="layui-form-label">期望薪资</label>
	                <div class="layui-input-inline">
	                  <select name="obtainSalary" lay-verify="required">
	                    <option value="">--请选择--</option>
	                    <option value="2000">2000以下</option>
	                    <option value="2500">2000-3000</option>
	                    <option value="3500">3000-4000</option>
	                    <option value="4500">4000-5000</option>
	                    <option value="5000">5000以上</option>
	                  </select>
	                </div>
	            </div>
      				<h1>专业技能掌握</h1>
      				<?php if(is_array($list)): foreach($list as $key=>$row): ?><div class="layui-form-item" >
	                <label class="layui-form-label"><?php echo ($row[1]); ?></label>
	                <div class="layui-input-inline">
	                  <select name="<?php echo ($row[0]); ?>" lay-verify="required">
	                    <option value="">--请选择--</option>
	                    <option value="1">精通</option>
	                    <option value="2">熟练掌握</option>
	                    <option value="3">掌握</option>
	                    <option value="4">熟悉</option>
	                    <option value="5">了解</option>
	                  </select>
	                </div>
	              </div><?php endforeach; endif; ?>

              <div class="layui-form-item">
                <div class="layui-input-inline">
                  <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                </div>
              </div>
            </form>
			</div>
        <script src="/woniu/Public/X-admin/lib/layui/layui.js" charset="utf-8"></script>
        <script src="/woniu/Public/X-admin/js/x-layui.js" charset="utf-8"></script>
          


        <script>

            layui.use(['laydate','element','laypage','layer','form'], function(){
              $ = layui.jquery;//jquery
              layer = layui.layer;//弹出层
  				    var form = layui.form();

              //对输入的信息进行Ajax验证
              //姓名匹配
              name1 = false;
              pass1 = false;
              repass1 = false;
              card = false; 
              address1 = false;
              phone1 =false;
              qq1 = false;
              email1 = false;
              contacts_name1 = false;
              contacts_phone1 = false;
              //姓名匹配
              $("input[name='name']").blur(function(){
                name = $(this).val();
                if(name.match(/[\u4E00-\u9FA5\uF900-\uFA2D]{2,4}/)){
                    $("#names").text("通过");
                    name1 = true;
                }else{
                    $("#names").text("姓名匹配错误");
                    $("#names").css('color',"red");
                    name1 = false;
                }
              });

              //密码正则匹配
              $("#password").blur(function () {
                  pass = $(this).val();
                  
                if(pass.match(/^[\w]{6,18}$/)){
                    $("#passs").text("通过");
                    pass1 = true;
                }else{
                    $("#passs").text("密码为六至十八位的任意数字字母");
                    $("#passs").css('color',"red");
                    pass1 = false;
                }
              });

              //验证密码匹配
              $("input[name='repassword']").blur(function(){
                  repass = $(this).val()
                  pass = $("input[name='password']").val();
                  if(repass!=pass){
                    $("#repasss").text("两次密码输入不一致");
                    $("#repasss").css('color',"red");
                    repass1 = true;
                  }else{
                    $("#repasss").text("通过");
                    repass1 = true;
                  }
              });

              //身份证号验证
              $("input[name='card']").blur(function(){
                  card = $(this).val();
                  if(card.match(/^\d{17}[0-9]|X$/)){

                      $.post("/woniu/index.php/Home/Login/preg_card",{card:card},function(data){
                          if(data==0){
                              $("#cards").text("身份证号验证通过");
                              card = true;
                          }else{
                            $("#cards").text("身份证号已存在");
                            $("#cards").css('color',"red");
                            card = false;
                          }
                      });

                  }else{
                    $("#cards").text("身份证号格式不正确");
                    $("#cards").css('color',"red");
                    card = false;
                  }
                  
              });

              //籍贯验证
              $("input[name='address']").blur(function(){
                  address = $(this).val();
                  if(address.match(/[\u4E00-\u9FA5\uF900-\uFA2D]{2,6}/)){
                      $("#addresss").text("通过");
                      address1 = true;

                  }else{
                      $("#addresss").text("格式不正确");
                      $("#addresss").css('color',"red");
                      address1 = false;
                  }
                  
              });

              //手机号码验证
              $("input[name='phone']").blur(function(){
                  phone = $(this).val();
                  if(phone.match(/^1[3|4|5|8][0-9]\d{4,8}$/)){

                      $.post("/woniu/index.php/Home/Login/preg_phone",{phone:phone},function(data){
                          if(data==0){
                              $("#phones").text("验证通过");
                              phone1 = true;
                          }else{
                            $("#phones").text("手机号码已存在");
                            $("#phones").css('color',"red");
                            phone1 = false;
                          }
                      });

                  }else{
                    $("#phones").text("手机号码格式不正确");
                    $("#phones").css('color',"red");
                    phone1 = false;
                  }
                  
              });

              //QQ号码验证
              $("input[name='QQ']").blur(function(){
                  QQ = $(this).val();
                  if(QQ.match(/[1-9][0-9]{4,11}/)){
                      $("#qqs").text("通过");
                      qq1 = true;

                  }else{
                      $("#qqs").text("格式不正确");
                      $("#qqs").css('color',"red");
                      qq1 = false;
                  }
                  
              });

              //email验证
              $("input[name='email']").blur(function(){
                  email = $(this).val();
                  if(email.match(/^[0-9a-z][_.0-9a-z-]{0,31}@([0-9a-z][0-9a-z-]{0,30}[0-9a-z]\.){1,4}[a-z]{2,4}$/)){
                      $("#emails").text("通过");
                      email1 = true;

                  }else{
                      $("#emails").text("格式不正确");
                      $("#emails").css('color',"red");
                      email1 = false;
                  }
                  
              });
              
              //联系人姓名匹配
              $("input[name='contacts_name']").blur(function(){
                contacts_name = $(this).val();
                if(contacts_name.match(/[\u4E00-\u9FA5\uF900-\uFA2D]{2,4}/)){
                    $("#contacts_names").text("通过");
                    contacts_name1 = true;
                }else{
                    $("#contacts_names").text("姓名匹配错误");
                    $("#contacts_names").css('color',"red");
                    contacts_name1 = false;
                }
              });

              //手机号码验证
              $("input[name='contacts_phone']").blur(function(){
                  contacts_phone = $(this).val();
                  if(contacts_phone.match(/^1[3|4|5|8][0-9]\d{4,8}$/)){
                      $("#contacts_phones").text("验证通过");
                      contacts_phone1 = true;
                  }else{
                    $("#contacts_phones").text("手机号码格式不正确");
                    $("#contacts_phones").css('color',"red");
                    contacts_phone1 = false;
                  }
                  
              });
              
            });
            function demo(){
              if(name1 & pass1 & repass1 & card & address1 & phone1 & qq1 & email1 & contacts_name1 & contacts_phone1){
                return true;
              }else{
                return false;
              }
            }
              
          </script>
   
    </body>
</html>